package org.piwicode.bywordofmouth;

import java.io.Serializable;
import java.util.Arrays;

/**
 *
 * @author pierre
 */
public class Hash implements Serializable {

    final byte hash[];

    public Hash(byte[] hash) {
        this.hash = hash;
    }

    @Override
    public int hashCode() {        
        return Arrays.hashCode(this.hash);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        final Hash other = (Hash) obj;
        if (!Arrays.equals(this.hash, other.hash)) return false;
        return true;
    }

    @Override
    public String toString() {
        return Arrays.toString(hash);
    }
    
}
